@model viBook.Models.ChapterComment

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.User.Username)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.User.Username)
    @Html.ValidationMessageFor(model => model.User.Username)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Content)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Content)
    @Html.ValidationMessageFor(model => model.Content)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.CreatedDate)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.CreatedDate)
    @Html.ValidationMessageFor(model => model.CreatedDate)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Vote)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Vote)
    @Html.ValidationMessageFor(model => model.Vote)
</div>

<div class="editor-label">
    Chapter
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ChapterId, ((IEnumerable<viBook.Models.Chapter>)ViewBag.PossibleChapters).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.Id.ToString(),
        Selected = (Model != null) && (option.Id == Model.ChapterId)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ChapterId)
</div>
